package com.chenhaonan.controller;

import com.chenhaonan.domain.Employee;
import com.chenhaonan.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class EmployeeController {
    @Autowired
    private EmployeeService service;
    @RequestMapping("list")
    public String list(Model model){
        List<Employee> em=service.selects();
        model.addAttribute("em",em);
        return "list";
    }
}
